文章背景与核心概要
在现代大型语言模型(LLM)的高吞吐量服务中,共享前缀的键值(KV)缓存是一项标准的优化技术。然而,当将其应用于新兴的扩散语言模型(DLMs)时,该技术却宣告失效。由于 DLM 采用双向注意力机制,修改任何单个标记(token)都会动态改变整个上下文,从而破坏传统的静态前缀 KV,导致模型准确率暴跌至接近零。
为了解决这一难题,本文作者推出了 BiCache(双向前缀缓存)——这是首个专为 DLM 中的共享前缀设计的 KV 缓存技术。BiCache 的核心洞察在于:在浅层网络中,共享前缀的 KV 保持稳定且可复用,其层深可以根据每个请求中共享前缀标记的比例进行动态缩放。通过动态确定用于复用的安全层深,BiCache 消除了冗余计算,在对准确率影响微乎其微(差异仅为 0–1.8%)的前提下,将服务吞吐量提升了 36.3% 至 98.3%。
为扩散语言模型启用共享前缀的 KV 缓存 (Enabling KV Caching of Shared Prefix for Diffusion Language Models)
arXiv: 2606.07571 [cs.LG]
录用会议: EMNLP 2026 主会 (Main Conference)
作者: Younghun Go, Jaehoon Han, Changyong Shin, Chuck Yoo, Gyeongsik Yang
官方代码: GitHub 仓库
📌 摘要 (Summary)
Key-value (KV) caching for shared prefixes is a standard optimization technique for high-throughput Large Language Model (LLM) serving. However, it fails when applied to emerging Diffusion Language Models (DLMs). Because DLMs employ bidirectional attention, modifying any single token dynamically alters the entire context, corrupting traditional static prefix KVs and causing model accuracy to collapse to near zero.
To overcome this, the authors introduce BiCache (Bidirectional Prefix Caching)—the first KV caching technique specifically designed for shared prefixes in DLMs. BiCache leverages the insight that shared prefix KVs remain stable and reusable in shallow layers, with layer depth scaling based on the fraction of shared prefix tokens per request. By dynamically determining a safe layer depth for reuse, BiCache eliminates redundant computations and boosts serving throughput by 36.3% to 98.3% with negligible impact on accuracy (0–1.8% difference).
针对高吞吐量大语言模型(LLM)服务,共享前缀的键值(KV)缓存是一项标准的优化技术。然而,当将其应用于新兴的扩散语言模型(DLMs)时,该技术却遇到了严重失效。由于 DLM 采用双向注意力机制,更新任何单个标记都会动态改变整个上下文及其对应的 KV。因此,假定 KV 一旦计算完成便保持不变的现有 LLM 缓存技术会破坏共享前缀的 KV。我们的实验表明,将这些技术应用于 DLM 会导致模型的准确率暴跌至接近零。
为了释放高吞吐量 DLM 服务的潜力,我们提出了双向前缀缓存技术——BiCache,这是首个针对 DLM 中共享前缀的 KV 缓存技术。BiCache 的设计基于我们全面分析得出的核心观察:在浅层中,共享前缀的 KV 保持稳定且可复用,而浅层的深度取决于每个请求中共享前缀标记的比例。因此,BiCache 可以动态识别出用于复用共享前缀 KV 的安全层深,从而消除冗余计算。评估表明,与现有技术相比,BiCache 在没有引起准确率崩溃的前提下(差异仅为 0-1.8%),将服务吞吐量显著提升了 36.3%-98.3%。
📋 论文元数据 (Paper Metadata)
| 属性 (Attribute) | 详情 (Details) |
|---|---|
| 主分类 (Primary Subject) | 机器学习 (cs.LG) |
| 次分类 (Secondary Subjects) | 人工智能 (cs.AI) |
| 提交历史 (Submission History) | • v1: 2026年5月26日 • v4 (最新): 2026年9月2日 |
| 许可证 (License) | 知识共享 署名-非商业性使用-禁止演绎 4.0 国际版 |
| 全文链接 (Full-Text Links) | • 查看 PDF • HTML 版本 • TeX 源码 |
🔍 摘要原文 (Abstract)
Key-value (KV) caching for shared prefixes is essential for high-throughput large language model (LLM) serving, but it faces critical challenges in emerging diffusion language models (DLMs). In DLMs, bidirectional attention means that updating any token dynamically alters the entire context and its corresponding KVs. Thus, existing caching techniques developed for LLMs, which assume that KVs remain invariant once computed, corrupt the shared prefix KVs. Our experiments show that applying these techniques to DLMs causes model accuracy to collapse to near zero.
To unlock high-throughput DLM serving, we propose bidirectional prefix caching, BiCache, the first KV caching technique for shared prefixes in DLMs. BiCache is designed based on key observations from our comprehensive analysis: shared prefix KVs remain stable and reusable in shallow layers, while the depth of shallow layers depends on the fraction of shared prefix tokens in each request. Thus, BiCache dynamically identifies a safe layer depth for reusing shared prefix KVs and eliminates redundant computation. Evaluations demonstrate that BiCache significantly improves serving throughput by 36.3%-98.3% compared to existing techniques without accuracy collapse (only 0-1.8% difference).
针对高吞吐量大语言模型(LLM)服务,共享前缀的键值(KV)缓存至关重要,但它在兴起的扩散语言模型(DLM)中面临着严峻的挑战。在 DLM 中,双向注意力意味着更新任何标记都会动态改变整个上下文及其相应的 KV。因此,现有的为 LLM 开发的缓存技术(假定 KV 一旦计算便保持不变)会破坏共享前缀的 KV。我们的实验表明,将这些技术应用于 DLM 会导致模型准确率暴跌至接近零。
为了释放高吞吐量的 DLM 服务,我们提出了双向前缀缓存 BiCache,这是首个针对 DLM 中共享前缀的 KV 缓存技术。BiCache 的设计基于我们全面分析得出的关键观察:共享前缀的 KV 在浅层中保持稳定且可复用,而浅层的深度取决于每个请求中共享前缀标记的比例。因此,BiCache 动态识别出复用共享前缀 KV 的安全层深,并消除了冗余计算。评估表明,与现有技术相比,BiCache 显著将服务吞吐量提升了 36.3%-98.3%,且没有发生准确率崩溃(仅有 0-1.8% 的差异)。
🌐 外部资源与工具 (External Resources & Tools)
- 引用与文献: Google Scholar | Semantic Scholar | NASA ADS
- 交互与社区工具: alphaXiv | CatalyzeX Code Finder | Hugging Face